package com.gcb.common.enums;

/**
 * 订单状态
 */
public enum OrderStateEnum {
    AUDIT(1, "待审核"),
    UNDERWAY(2, "进行中"),
    PAUSED(3, "已暂停"),
    FINISHED(4, "已结束"),
    CANCELED(5, "已取消");

    private final Integer code;
    private final String info;

    OrderStateEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfo(Integer code) {
        for (OrderStateEnum orderState : OrderStateEnum.values()) {
            if (orderState.getCode().equals(code)) {
                return orderState.getInfo();
            }
        }
        return null;
    }
}
